<?php
/**
* This file produce some common functions
* @author RainX <rainx1982@gmail.com>
*/

/// 判断log函数是否生效
define("SOLOR_DEBUG", 0);
/// 用来打印log的函数
function SOLOR_LOG($word)
{
    if (SOLOR_DEBUG)
        error_log("[solor_debug] $word");
}

/// 只查看数组成员里的 ['url'] 属性是否相同，然后决定是否进行合并
function sr_array_unique($arr)
{
    $ret = array();
    foreach ($arr as $row)
    {
        $has  = false;
        foreach ($ret as $line)
        {
            if ($row['url'] == $line['url'])
            {
                $has = true;
                break;
            }
        }

        if (!$has)
        {
            $ret[] = $row;
        }
    }
    return $ret;
}


?>
